<%-- 
    Document   : index6.jsp
    Created on : 2015-9-24, 14:05:50
    Author     : Fire
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script src="plugins/react/react.js" type="text/javascript"></script>
        <script src="plugins/react/browser.min.js" type="text/javascript"></script>
    </head>
    <body>
        <script type="text/babel">
            var data=123;
            var MyTitle = React.createClass({//注意MyTitle关键词的定义  不能随便定义
                propTypes:{
                    title:React.PropTypes.string.isRequired,
                },
                render:function(){
                    return <h1>{this.props.title}</h1>;
                }
            });
            React.render(
               <MyTitle title={data}/>,
               document.body
            );
        </script>
    </body>
</html>
